local Lua__yongshen = fk.CreateSkill {

  name = "Lua__yongshen",

  tags = { Skill.Compulsory, },

}

Fk:loadTranslationTable{
    ["Lua__yongshen"] = "永神",
    ["$Lua__yongshen1"] = "uzi，yyds",
    ["#Lua__yongshenLoseHp"] = "永神",
    [":Lua__yongshen"] = "锁定技，你的回合开始时，你依次获得以下一个效果：1.攻击距离+2。2.手牌上限+2。3.你使用的牌不可被响应。",
    ["@@yongshen_distance"] = "永神距离",
    ["@@yongshen_loseHp"] = "永神流失",
    ["@@yongshen_maxcards"] = "永神上限",
    ["@@yongshen_noresp"] = "永神响应",
}

Lua__yongshen:addEffect(fk.TurnStart, {
    anim_type = "special",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(Lua__yongshen.name) and player:getMark("yongshen_effect") ~= 3
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:addPlayerMark(player, "yongshen_effect", 1)
        local effect_index = player:getMark("yongshen_effect")
        -- 应用相应效果
        if effect_index == 1 then
            -- 攻击距离+2
            room:setPlayerMark(player, "@@yongshen_distance", 1)
        elseif effect_index == 2 then
            -- 手牌上限+2
            room:setPlayerMark(player, "@@yongshen_maxcards", 1)
        elseif  effect_index == 3 then
            -- 牌不可被响应
            room:setPlayerMark(player, "@@yongshen_noresp", 1)
        end
    end,
})

Lua__yongshen:addEffect("atkrange", {
    correct_func = function (self, from, to)
        if from:getMark("@@yongshen_distance") > 0 then
            return 2
        end
    end,
})

Lua__yongshen:addEffect("maxcards", {
    correct_func = function(self, player)
        if player:getMark("@@yongshen_maxcards") > 0 then
            return 2
        end
    end,
})

Lua__yongshen:addEffect(fk.CardUsing, {
    mute = true,
    can_trigger = function(self, event, target, player, data)
        return target == player and player:getMark("@@yongshen_noresp") > 0
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        data.disresponsiveList = table.simpleClone(player.room.players)
    end,
})

return Lua__yongshen